/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.app.command;

import chunmap.app.MapCtrl;
import chunmap.app.bench.Command;
/**
 * @author chunquedong
 * 
 */
public class ZoomCommand  implements Command {
	private double _s;
    private MapCtrl map;
    private double _x;
    private double _y;

    public ZoomCommand(MapCtrl map, double s, double x, double y)
    {
        this.map = map;
        this._s = s;
        this._x = x;
        this._y = y;
    }

    public void execute()
    {
        map.getView().zoom(_s, _x, _y);
    }


    public boolean isUndoable()
    {
        return true;
    }

    public void rollback()
    {
        map.getView().zoom(1d / _s, _x, _y);
    }
}